<#import "/ftl/mainAdmin.ftl" as page>

<@page.mainTemplate styleSheet="commanageCss" jsFile="goodsManageJs" current="公司信息">
	<div class="page-content">
		<div class="page-head">
			<div class="page-title">
				<h1>商户关系
					<small>商户关系配置</small>
				</h1>
			</div>
		</div>
		<div class="row">
			<div class="portlet light borderd">
				<div class="portlet-body form edit-form">
					<form action="#" id="createForm" class="createForm" style="width:50%">
                    	<input type="hidden" id="merchant_id" name="merchant_id" value="${companyVO.id}" />                  	
                    	<input type="hidden" id="merchant_name" name="merchant_name" value="${companyVO.company_name}" />
                    	
                        <input type="hidden" id="company_ids" name="company_ids" value="${idStr}" />
                        <input type="hidden" id="company_names" name="company_names" value="${nameStr}" />
	                    <div class="form-group">
					       <div class="input-group">
                                <label class="input-group-addon">商户</label>
                                <div class="input-group-content">                                    
                                    <input type="text" id="data_type_str" name="data_type_str" class="form-control" placeholder="商户" value="${companyVO.company_name}" readonly="readonly" style="width:500px;"/>
                                </div>
                            </div>
                        </div>								    
						<div class="form-group">
                           <div class="input-group">
                                <label class="input-group-addon">关系对象</label>
                                <div class="input-group-content">
                                    <select class="form-control input-inline" name="publishCompanyRelation" style="width:500px">
                                        <option value="">请选择公司</option>
                                    </select>
                                </div>
                            </div>
                            <input type="hidden" id="business_ids" name="business_ids" class="form-control"   value="" >
                             <ul class="list-group" id="companyRelationList" style="width: 500px;margin-left: 111px;">
                            	<#list merchantVOList as list>
                                    <li class="list-group-item" data-id="${list.company_id}" data-name="${list.company_name}"> ${list.company_name}
                                        <span class="pull-right ">
                                            <a class="btn btn-xs red" name="delete">删除</a> 
                                        </span>
                                    </li>
                                </#list>
                            </ul>
                		</div>              		                		
                		<div class="form-actions top">
                			<div class="row">
                				<button type="submit" id="merchantRelationSave" class="btn green GoodsSave">保存</button>               				
                				<a href="${context}/company/search_view_company" class="btn default">返回</a>
                			</div>
                		</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script>
		function check(v){
		    var num = $(v).val();
			var a=/^[0-9]*(\.[0-9]{1,2})?$/;
				if(!a.test(num)){
					$(".tips").css("display","")
					$(v).val("");
					return false;
				}else{
					$(".tips").css("display","none")
				}
		}
	</script>
</@page.mainTemplate>